use Test;
use Rollout qw/text_install file_comment file_uncomment/;
use strict;

BEGIN { plan tests => 7 }

text_install("/tmp/foo", <<EOTEXT);
line 1
line 2
# line 3
#line 4
	# line 5
EOTEXT

ok(file_comment("/tmp/foo", qr/^line 1/));
ok(!file_comment("/tmp/foo", qr/^line 1/));
ok(file_comment("/tmp/foo", "line 2"));
ok(file_uncomment("/tmp/foo", qr/^line 3/));
ok(file_uncomment("/tmp/foo", qr/^line 4/));
ok(file_uncomment("/tmp/foo", qr/^line 5/));
ok(!file_uncomment("/tmp/foo", qr/^asd/));
